package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.Cart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 操作购物车相关数据接口
 */
public interface CartMapper extends BaseMapper<Cart> {

    int updateById(Cart cart);

    Cart selectById(Integer id);

    List<Cart> selectAll(Cart cart);

    @Delete("delete from cart where business_id = #{businessId} and user_id = #{userId}")
    void deleteByBusiness(@Param("businessId") Integer businessId, @Param("userId") Integer userId);

}